import TabsView from '@/layouts/tabs/TabsView'
import BlankView from '@/layouts/BlankView'
import PageView from '@/layouts/PageView'

// 路由配置
const options = {
  routes: [
    {
      path: '/login',
      name: '登录页',
      component: () => import('@/pages/login')
    },
    {
      path: '*',
      name: '404',
      component: () => import('@/pages/exception/404'),
    },
    {
      path: '/403',
      name: '403',
      component: () => import('@/pages/exception/403'),
    },
    {
      path: '/',
      name: '首页',
      component: TabsView,
      redirect: '/login',
      children: [
        {
          path: 'demo',
          name: '演示页',
          meta: {
            icon: 'file-ppt'
          },
          component: () => import('@/pages/demo')
        },
        // {
        //   path: 'parent1',
        //   name: '父级路由1',
        //   meta: {
        //     icon: 'dashboard',
        //   },
        //   component: BlankView,
        //   children: [
        //     {
        //       path: 'demo1',
        //       name: '演示页面1',
        //       component: () => import('@/pages/demo'),
        //     }
        //   ]
        // },
        {
          path: 'user',
          name: '用户',
          meta: {
            icon: 'user',
          },
          component: BlankView,
          children: [
            {
              path: 'queryuser',
              name: '商城用户',
              component: () => import('@/pages/user/QueryList'),
            }, {
              path: 'admin',
              name: '管理员',
              component: () => import('@/pages/admin/index'),
            }
          ]
        },
        {
          path: 'product',
          name: '商品',
          meta: {
            icon: 'product',
          },
          component: BlankView,
          children: [
            {
              path: 'index',
              name: '所有商品',
              component: () => import('@/pages/product/index'),
            },
            {
              path: 'categories',
              name: '商品分类',
              component: () => import('@/pages/product/categories'),
            },
            {
              path: 'carousel',
              name: '轮播图',
              component: () => import('@/pages/product/carousel'),
            }
          ]
        },
        {
          path: 'order',
          name: '订单',
          meta: {
            icon: 'order',
          },
          component: PageView,
          children: [
            {
              path: 'index',
              name: '所有订单',
              component: () => import('@/pages/order/index'),
            }
          ]
        },
        // {
        //   path: 'parent2',
        //   name: '父级路由2',
        //   meta: {
        //     icon: 'form'
        //   },
        //   component: PageView,
        //   children: [
        //     {
        //       path: 'demo2',
        //       name: '演示页面2',
        //       component: () => import('@/pages/demo'),
        //     }
        //   ]
        // },

        // {
        //   path: 'exception',
        //   name: '异常页',
        //   meta: {
        //     icon: 'warning',
        //   },
        //   component: BlankView,
        //   children: [
        //     {
        //       path: '404',
        //       name: 'Exp404',
        //       component: () => import('@/pages/exception/404')
        //     },
        //     {
        //       path: '403',
        //       name: 'Exp403',
        //       component: () => import('@/pages/exception/403')
        //     },
        //     {
        //       path: '500',
        //       name: 'Exp500',
        //       component: () => import('@/pages/exception/500')
        //     }
        //   ]
        // },
        {
          name: '验权页面',
          path: 'auth/demo',
          meta: {
            icon: 'file-ppt',
            authority: {
              permission: 'form',
              role: 'manager'
            },
            component: () => import('@/pages/demo')
          }
        }
      ]
    }
  ]
}

export default options
